package com.hosever.action;

import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Date;

import javax.swing.Timer;

public class TimerTest implements ActionListener {

	@Override
	public void actionPerformed(ActionEvent e) {
		Date now = new Date();
		System.out.println("123123:"+now);
		Toolkit.getDefaultToolkit().beep();
	}
	
	public static void main(String[] args) {
		ActionListener al = new TimerTest();
		Timer t = new Timer(1000, al);
		t.start();
	}
}
